import axios from "axios";
import qs from 'qs';

// 根据环境 设置不同的baseURL
// let baseURL= 'http://127.0.0.1:3000';
let baseURL= 'http://10.129.206.225:3000';

//登录
export let LoginApi = (str) => {
    return axios({
        url: baseURL+"/search?keywords="+str
    });
};

// 搜索
export let searchApi = (name,num=0) => {
    let optional = num?`&limit=${num}`:''
    return axios({
        url: `${baseURL}/search?keywords=${name}${optional}`
    })
}

// 获取歌曲url
export let getSongUrl = (id) => {
    return axios({
        url:`${baseURL}/song/url?id=${id}`
    })
}

// 获取歌词
export let getSongWords = (id) => {
    return axios({
        url: `${baseURL}/lyric?id=${id}`
    })
}
